<?php
/**
 * Default Template for RoomBooking view
 */
defined('_JEXEC') or die('Restricted access'); 
$document =& JFactory::getDocument();
$document->addStyleSheet(JURI::base(). 'components/com_roombooking/assets/css/table.css');
$document->addScript(JURI::base(). 'components/com_roombooking/assets/js/jquery/jquery-1.5.2.min.js');
$document->addScript(JURI::base(). 'components/com_roombooking/assets/js/select.js');
$js="function check(){
if (document.getElementById('id_organization').value>=1 && 
   document.getElementById('id_building').value>=1 && document.getElementById('id_room').value>=1) 
	document.forms['adminForm'].submit();
else
	window.alert('".JText::_( 'PLSELROOM' )."');
}";
$document->addScriptDeclaration($js);
?>
<div class="componentheading"><?php echo JText::_( 'SELROOM' ); ?></div>
<p><?php echo JText::_( 'SELORGBUILDROOM' );?></p>
<div class="col100" align="center">
<br />
		<table class="admintable">
			<tr>
				<td><label for="id_organization"><?php echo JText::_( 'ORGANIZATION' );?>:</label></td>
				<td><select class="inputbox" id="id_organization" name="id_organization" onchange="selBuildings(this.value)" style="width:350px">
						<option value="" selected="selected">- <?php echo JText::_( 'SELORG' );?> -</option>
						<?php foreach ($this->organizations as $organization){
							echo "<option value='".$organization->id."'>".$organization->name."</option>";
						} ?>
					</select>
				</td>
			</tr>
		</table>
	<br />
		<table id="building_table" class="hor-minimalist-b adminlist">
			<thead>
				<tr ><th colspan="6"><?php echo JText::_( 'BUILDINGS' ); ?></th></tr>
				<tr>
					<th width="20">#</th>
					<th width="230"><?php echo JText::_( 'NAME' ); ?></th>
					<th width="170"><?php echo JText::_( 'ADDRESS' ); ?></th>
					<th width="80"><?php echo JText::_( 'OPENINGTIME' ); ?></th>
					<th width="80"><?php echo JText::_( 'CLOSINGTIME' ); ?></th>
					<th width="110"><?php echo JText::_( 'WEOPEN' ); ?></th>
				</tr>            
			</thead>
			<tbody id="id_building">
			</tbody>
		</table>
<br /><br />
		<table id="room_table" class="hor-minimalist-b adminlist">
			<thead>
				<tr ><th colspan="6"><?php echo JText::_( 'ROOMS' ); ?></th></tr>
				<tr>
					<th width="20">#</th>
					<th width="300"><?php echo JText::_( 'NAME' ); ?></th>
                                        <th width="80"><?php echo JText::_( 'NUMSEATS' ); ?></th>
					<th width="120"><?php echo JText::_( 'FLOOR' ); ?></th>
					<th width="120"><?php echo JText::_( 'COSTPERHOUR' ); ?></th>
				</tr>            
			</thead>
			<tbody id="id_room">
			</tbody>
		</table>
		
		
</div>



